using Microsoft.AspNetCore.Http;

namespace QQZiFramework.Mvc
{
    public interface IQQZiController
    {
        DBContext CreateDBContext();
        HttpContext HttpContext { get; }

        bool IsApplicationJson { get; }

        /// <summary>
        /// 获取参数值
        /// </summary>
        /// <param name="name">参数名称</param>
        /// <param name="maxLength">最大长度，超过则报异常</param>
        /// <param name="throwNull">如果参数为空是否报异常</param>
        /// <returns></returns>
        string GetParamValue(string name, int maxLength, bool decode, bool throwNull);

        /// <summary>
        /// 获取要保存的实体json
        /// </summary>
        string GetEditEntity();
    }

}